public class TestPoint {
    public static void main(String[] args) {
        Point p1 = new Point();
        p1.x = 10;
        p1.y = 20;
        p1.z = 33;

        Point p2 = new Point();
        p2.x = 33;
        p2.y = 44;
        p2.z = 55;
        //函数里面相当于 p = p2
        double rel = p1.getDistance(p2);

        System.out.println(rel);
    }
}

class Point {
    double x;
    double y;
    double z;

    public double getDistance(Point p) {
        double t = (x-p.x)*(x-p.x) + (y-p.y)*(y-p.y)+(z-p.z)*(z-p.z);
        return Math.sqrt(t);
    }
}
